package com.cadre.common.utils.oldutil;

import java.util.regex.Pattern;

/* loaded from: NStringUtils.class */
public class NStringUtils {
    public static int getWordCount(String s) {
        int length = 0;
        for (int i = 0; i < s.length(); i++) {
            int ascii = Character.codePointAt(s, i);
            if (ascii < 0 || ascii > 255) {
                length += 2;
            } else {
                length++;
            }
        }
        return length;
    }

    public static String[] splitText(String str) {
        return (str == null || "".equals(str)) ? new String[]{""} : Pattern.compile("(\r\n)|\r|\n").matcher(str).replaceAll("☀").split("☀");
    }
}
